package com.dhcc.bpm.modules.system.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dhcc.bpm.modules.system.entity.Param;
import com.dhcc.bpm.modules.system.mapper.ParamMapper;
import com.dhcc.bpm.modules.system.service.IParamService;
import com.dhcc.bpm.modules.system.vo.ParamVO;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName ParamServiceImpl
 * @Description  服务实现类
 * @Author sjm
 * @Date 2020/2/21 0021 15:16
 * @Version V1.0
 * @Copyright: 2020 东华软件 . All rights reserved.
 **/
@Service
public class ParamServiceImpl extends BaseServiceImpl<ParamMapper, Param> implements IParamService {

	@Autowired
	private ParamMapper paramMapper;

	/**
	 * 自定义分页
	 * @Author sjm
	 * @Date 19:16 2020/2/21 0021
	 * @param page
	 * @param param
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.system.vo.ParamVO>
	 **/
	@Override
	public IPage<ParamVO> selectParamPage(IPage<ParamVO> page, ParamVO param) {
		return page.setRecords(baseMapper.selectParamPage(page, param));
	}

	/**
	 * 根据key查询参数值
	 * @Author sjm
	 * @Date 19:16 2020/2/21 0021
	 * @param paramKey
	 * @return com.dhcc.bpm.modules.system.entity.Param
	 **/
	@Override
	public Param getParamByKey(String paramKey) {
		return paramMapper.getParamByKey(paramKey);
	}

}
